package com.techysky.vo;

import java.io.Serializable;

public class DataBase implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	 private String ip;
	 private String port="3306";
	 private String userName="root";
	 private String password="techysky123";
	 private String dbType="MYSQL";
	 private String driver="com.mysql.jdbc.Driver";
	 private String db="hhmse";
	 private String url;
	 
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getDbType() {
		return dbType;
	}

	public void setDbType(String dbType) {
		this.dbType = dbType;
	}

	public String getDriver() {
		return driver;
	}

	public void setDriver(String driver) {
		this.driver = driver;
	}

	public String getDb() {
		return db;
	}

	public void setDb(String db) {
		this.db = db;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getUrl() {
		if("ORACLE".equalsIgnoreCase(dbType)) {
			return "jdbc:oracle:thin:@"+ip+":"+db;
		}else if("SQLSERVER".equalsIgnoreCase(dbType)) {
			return "";
		}else if("MYSQL".equalsIgnoreCase(dbType)) {
			return "jdbc:mysql://"+ip+":"+port+"/"+db+"?useSSL=false";
		}
		return url;
	}
}
